package com.hqyj.controller;

import com.hqyj.pojo.ResultVo;
import com.hqyj.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Autor 伍军
 * @Date 2022/9/22 14:21
 * @Version 1.0
 **/
@RestController
@RequestMapping("/user")
public class UserInfoController {
    @Autowired
    UserInfoService userInfoService;
    //邮件发送
    @GetMapping("/sendCode")
    public ResultVo sendCode(String email){
        return userInfoService.sendCode(email);
    }
    //短信发送
    @GetMapping("/sendSmsCode")
    public ResultVo sendSmsCode(String phone){
        return userInfoService.sendSmsCode(phone);
    }

    @GetMapping("/emailLogin")
    public ResultVo emailLogin(String email,String code){
        return userInfoService.emailLogin(email,code);
    }

    @GetMapping("/queryByName")
    public ResultVo queryByName(String name){
        return userInfoService.queryByName(name);
    }
}
